var path = document.location.pathname;
var dir = path.substring(path.indexOf('/'), path.indexOf('/',path.lastIndexOf('www')));
//looking for javascript, start at .../www/
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/cordova.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/cordova.qt.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/connection.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/console.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/device.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/file.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/geolocation.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/notification.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/compass.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/accelerometer.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/camera.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/contacts.js"></script>');
//document.write('<script language="javascript" type="text/javascript" src="' + dir +'/js/media.js"></script>');

//for main index
document.write('<script language="javascript" type="text/javascript" src="js/cordova.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/cordova.qt.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/connection.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/console.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/device.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/file.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/geolocation.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/notification.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/compass.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/accelerometer.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/camera.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/contacts.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/media.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/tizensysteminfo.js"></script>');

//for lv-2 index html
document.write('<script language="javascript" type="text/javascript" src="../js/cordova.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/cordova.qt.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/connection.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/console.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/device.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/file.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/geolocation.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/notification.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/compass.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/accelerometer.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/camera.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/contacts.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/media.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../js/tizensysteminfo.js"></script>');

//for lv-3 index html
document.write('<script language="javascript" type="text/javascript" src="../../js/cordova.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/cordova.qt.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/connection.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/console.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/device.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/file.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/geolocation.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/notification.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/compass.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/accelerometer.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/camera.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/contacts.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/media.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="../../js/tizensysteminfo.js"></script>');



//for debugger
//document.write('<script src="http://192.168.2.14:8080/target/target-script-min.js#anonymous"></script>');




